<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>找回密码 - 账户安全</title>
    <style>
        /* 全局样式重置与基础设置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        body {
            background-color: #f0f2f5;
            background-image: 
                radial-gradient(circle at 10% 20%, rgba(66, 153, 225, 0.05) 0%, transparent 20%),
                radial-gradient(circle at 90% 80%, rgba(66, 153, 225, 0.05) 0%, transparent 20%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        /* 主容器样式 */
        .box {
            width: 100%;
            max-width: 420px;
            background-color: #ffffff;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            padding: 35px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .box:hover {
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
        }

        /* 标题样式 */
        .box h2 {
            color: #1a1a1a;
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 8px;
            text-align: center;
        }

        .subtitle {
            color: #666;
            font-size: 14px;
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid #f0f0f0;
        }

        /* 表单组样式 */
        .form-group {
            margin-bottom: 22px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #4a4a4a;
            font-size: 14px;
            font-weight: 500;
        }

        /* 输入框样式 */
        .form-control {
            width: 100%;
            padding: 13px 15px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 15px;
            color: #333;
            transition: all 0.25s ease;
            background-color: #fafafa;
        }

        .form-control:focus {
            outline: none;
            border-color: #4299e1;
            box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
            background-color: #ffffff;
        }

        .form-control::placeholder {
            color: #a0a0a0;
            font-size: 14px;
        }

        /* 密保问题样式 */
        .security-question {
            display: flex;
            align-items: center;
            padding: 13px 15px;
            background-color: #f8f9fa;
            border: 1px solid #eee;
            border-radius: 8px;
            margin-bottom: 8px;
            color: #4a4a4a;
            font-size: 15px;
        }

        .security-question i {
            color: #4299e1;
            margin-right: 10px;
        }

        /* 按钮样式 */
        .btn-submit {
            width: 100%;
            padding: 14px;
            background-color: #4299e1;
            color: #ffffff;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 10px;
        }

        .btn-submit:hover {
            background-color: #3182ce;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
        }

        .btn-submit:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(66, 153, 225, 0.2);
        }

        /* 错误提示样式 */
        .error-message {
            color: #e53e3e;
            font-size: 14px;
            text-align: center;
            padding: 12px;
            background-color: #fff5f5;
            border: 1px solid #ffe3e3;
            border-radius: 6px;
            margin-bottom: 20px;
            animation: shake 0.5s ease;
        }

        /* 动画效果 */
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20%, 60% { transform: translateX(-5px); }
            40%, 80% { transform: translateX(5px); }
        }

        /* 链接样式 */
        .back-link {
            display: block;
            text-align: center;
            margin-top: 25px;
            color: #4299e1;
            font-size: 14px;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .back-link:hover {
            color: #3182ce;
            text-decoration: underline;
        }

        /* 响应式适配 */
        @media (max-width: 480px) {
            .box {
                padding: 25px 20px;
            }

            .box h2 {
                font-size: 22px;
            }

            .form-group {
                margin-bottom: 18px;
            }
        }
    </style>
</head>
<body>
    <div class="box">
        <h2>找回密码</h2>
        <p class="subtitle">通过密保验证重置您的密码</p>
        
        <form action="SellerServlet?method=checkSecurity" method="post">
            <!-- 错误提示 -->
            <c:if test="${not empty error}">
                <p class="error-message">${error}</p>
            </c:if>
            
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" class="form-control" required placeholder="请输入您的用户名">
            </div>
            
            <div class="form-group">
                <label>密保问题</label>
                <div class="security-question">
                    <i>🔒</i> 我的宠物名字?
                </div>
            </div>
            
            <div class="form-group">
                <label for="answer">密保答案</label>
                <input type="text" id="answer" name="answer" class="form-control" required placeholder="请输入密保答案">
            </div>
            
            <div class="form-group">
                <button type="submit" class="btn-submit">验证并重置密码</button>
            </div>
            
            <a href="seller_login.jsp" class="back-link">返回登录页面</a>
        </form>
    </div>
</body>
</html>
